package com.atguigu.srb.core.controller.admin;


import com.atguigu.srb.base.result.R;
import com.atguigu.srb.core.pojo.entity.LendReturn;
import com.atguigu.srb.core.service.LendReturnService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 还款记录表 前端控制器
 * </p>
 *
 * @author Atguigu
 * @since 2023-01-04
 */
@RestController
@RequestMapping("/admin/core/lendReturn")
public class AdminLendReturnController {
    @Resource
    LendReturnService lendReturnService;

    @ApiOperation("查询标的的还款计划")
    @GetMapping("/listByLendId/{lendId}")
    public R listByLendId(@PathVariable("lendId")String lendId){
        return R.ok().data("items",lendReturnService.list(Wrappers.lambdaQuery(LendReturn.class)
            .eq(LendReturn::getLendId ,lendId)));
    }

}

